package collection02;

import collection.Point;

import java.util.ArrayList;
import java.util.Collection;

public class CollectionDemo {
    public static void main(String[] args) {
        Collection c=new ArrayList();
        c.add(new Point(1,2));
        c.add(new Point(3,4));
        c.add(new Point(5,6));
        c.add(new Point(7,8));
        c.add(new Point(9,0));
        System.out.println(c);

        Point p =new Point(1,2);
        boolean num=c.contains(p);
        System.out.println(num);

        c.remove(p);
        System.out.println(c);

        Collection c1=new ArrayList();
        collection02.Point p1 = new collection02.Point(1,2);
        c1.add(p1);
        System.out.println(p1);
        System.out.println(c1);

        p1.setX(000);
        System.out.println(p1);
        System.out.println(c1);

        Collection c2=new ArrayList();
        c2.add("one");
        c2.add("two");
        c2.add("three");
        c2.add("four");
        c2.add("five");
        System.out.println(c);

        System.out.println("size:"+c2.size());
        System.out.println("是否为空集："+c2.isEmpty());

        c2.clear();
        System.out.println(c2);
        System.out.println("size:"+c2.size());
        System.out.println("是否为空集："+c2.isEmpty());


    }

}
